#include "mainwindowplugin.h"
#include "service/event/ctkEventAdmin.h"
#include <iostream>
#include "mainwindow.h"

MainWindowPlugin::MainWindowPlugin(ctkPluginContext *context)
        : context_(context)
{
    main_window_ = new MainWindow(context);
    connect(this, &MainWindowPlugin::sig_delete, this, &MainWindowPlugin::deletePage);
}

void MainWindowPlugin::popWindow()
{
    main_window_->show();
}

void MainWindowPlugin::deletePage()
{
    if(main_window_)
    {
        delete main_window_;
        main_window_ = nullptr;
    }
}